<?php
define('ZH', '.php');
define('LOG', '.log');
define('DS', DIRECTORY_SEPARATOR);
define('ZH_PATH',dirname(dirname(__FILE__)));//定义系统目录
define('ISZHMVCBUG',false);//定义是否调试
define('SIGNATURENEW','lzbanzhu202301');
define('MANAGERFPATH','kcmanager');
define('XCXAPPID','wxb9c0587c5a3a9d28');
define('XCXAPPSECRET','2ed68457413b162793b06c67efb99609');
header('Access-Control-Allow-Origin:*'); 

// 启动程序时间
define('START_TIME', microtime(true));

// 设置字符集编码、IE文档模式
header('Content-Type:text/html; charset=utf-8');
header('X-UA-Compatible:IE=edge,chrome=1');
header('X-Powered-By:ZHMVC');
// PHP版本检测
if (PHP_VERSION < '5.4') {
    header('Content-Type:text/html; charset=utf-8');
    exit('您服务器PHP的版本太低，程序要求PHP版本不小于5.4');
}

if(ISZHMVCBUG==true)
{
    error_reporting(E_ALL);
    ini_set('display_errors', '1');
}
else
{
    error_reporting(0);//E_ALL 0
    ini_set('display_errors', '0');//1 0
}
if (! isset($_SESSION)) {
    session_start();
}

include_once(ZH_PATH.DS."common".DS."tool".DS."Fun".ZH);
include_once(ZH_PATH.DS."common".DS."ZhLoader".ZH);
include_once(ZH_PATH.DS."vendor".DS."autoload".ZH);
include_once(ZH_PATH.DS."zhconfig".DS."version".ZH);

$path=ZH_PATH."/s/t/default/";
$path1="/s/t/default/";
$sysconn = new \ZHMVC\D\SystemConfig();
$srs1 = $sysconn->getOne1("`name`='cfg_tpl_dir'");
$srsnum1 = $sysconn->getRows();
if($srsnum1>0)
{
    $path=ZH_PATH.$srs1['value'].DS;
    $path1=$srs1['value'].DS;
}
$banzhudomain="https://rkshop.ruikang.top";
$srs1 = $sysconn->getOne1("`name`='SiteUrl'");
$srsnum1 = $sysconn->getRows();
if($srsnum1>0)
{
    $banzhudomain=$srs1['value'];
}
define('BANZHUDOMAIN',$banzhudomain);
$smarty = new \Smarty();
$smarty->setTemplateDir($path);
$smarty->setCompileDir(ZH_PATH.DS."data".DS."smartycompile".DS);
$smarty->setCacheDir(ZH_PATH.DS."data".DS."cache".DS);
$smarty->caching = true;
$smarty->debugging = FALSE;
$smarty->debug_tpl = ZH_PATH.DS."/mod/smarty/debug.tpl";
$smarty->debugging_ctrl = 'URL';
$smarty->cache_lifetime = 300;
$smarty->left_delimiter  = '{@#';
$smarty->right_delimiter = '#@}';

$CssRand=getRandChar(6);
$smarty->assign("CssRand", $CssRand);
$smarty->registerPlugin("function", "RepModule", "RepModule");
$smarty->registerPlugin("function", "RepPlus", "RepPlus");
$smarty->assign('PageCss','<LINK href="/common/css/pagecss.css" type="text/css" rel="stylesheet">');
$smarty->assign("cfg_tpl_dir", $path1);

//getTemplateCommon($smarty);